import QtQuick 1.0
import Olendarenko.ClipboardModel 1.0

Item {
	id: container

	property alias model: clipView.model
	property alias highlightComponent: clipView.highlight
	property url highlightSource: "../images/highlight.png"
	property int highlightBottom: 5
	property int highlightLeft: 1
	property int highlightRight: 1
	property int highlightTop: 5

	width: 400
	height: 140

	ClipboardModel {
		id: clipModel
	}

	PathView {
		id: clipView
		anchors.fill: parent

		model: clipModel
		delegate: ClipViewDelegate {}

		focus: true

		highlight: ClipViewHighlight {
			source: container.highlightSource
			border {
				left: container.highlightLeft
				right: container.highlightRight
				top: container.highlightTop
				bottom: container.highlightBottom
			}
			width: clipView.width - x
			height: 32
		}

		preferredHighlightBegin: 0.5
		preferredHighlightEnd: 0.5

		flickDeceleration: 80
		pathItemCount: 7

		path: Path {
			startX: 0; startY: 10
			PathAttribute { name: "itemScale"; value: 0.25 }
			PathQuad { x: 30; y: 70; controlX: 30; controlY: 10 }
			PathAttribute { name: "itemScale"; value: 1.0 }
			PathQuad { x: 0; y: 130; controlX: 30; controlY: 130 }
			PathAttribute { name: "itemScale"; value: 0.25 }
		}

		Keys.onDownPressed: clipView.incrementCurrentIndex()
		Keys.onUpPressed: clipView.decrementCurrentIndex()
		Keys.onRightPressed: clipModel.activate(currentIndex)
	}

	Text {
		text: clipView.moving + "\n" + clipView.flicking
		color: "red"
		font.pixelSize: 15
	}
}
